<template>
    <div id="top">
        <van-nav-bar
                :title="title"
                left-text="返回"
                right-text="…"
                :fixed="fixed"
                left-arrow
                @click-left="onClickLeft"
                @click-right="onClickRight"
        >
        </van-nav-bar>
    </div>
</template>

<script>
    export default {
        props:{
            title:''
        },
        data(){
            return{
                fixed: true
            }
        },
        methods:{
            onClickLeft: function () {
                if(this.title=='个人信息'){
                  this.$router.push('/');
                  return;
                }

                var res = this.$router.go(-1);
                if(!res){
                  this.$router.push('/');
                }
            },
            onClickRight: function () {
              this.$router.push('/home');
            }
        }
    }
</script>
<style>
   #top .van-nav-bar{
        background: #fff;
        color: #3b3b3b;
    }
    #top .van-nav-bar .van-icon,#top .van-nav-bar .van-nav-bar__text{
        color: #3b3b3b;
    }
    #top .van-nav-bar__right .van-nav-bar__text{
        font-size: 0.7rem;
        margin-top: 0.5rem;
        vertical-align: unset;
        line-height: 0.5rem;
        letter-spacing: .05rem;
    }
</style>
